package com.nikunj.www.hibernate.main;

import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.nikunj.www.hibernate.model.Person;
import com.nikunj.www.hibernate.service.PersonService;

public class TestMain {
	
	public static void main( String[] args )
    {
      ApplicationContext ctx = 
        new ClassPathXmlApplicationContext("spring.xml");
      PersonService personService = 
        (PersonService) ctx.getBean("personServiceImpl");
      
      List<Person> persons = personService.getPersons();
      
      for(Person person:persons){
    	  System.out.println("Person: firstname:"+person.getFirstName());
      }
    }


}
